<?php
include('../../inc/global.inc');
$url=$_SERVER['HTTP_REFERER'];
?>
<?php
if($_POST[tj_act]){
mysql_query("update  faq set faq_answer='$_POST[faq_answer]',faq_sh='$_POST[faq_sh]',faq_xs='$_POST[faq_xs]' where id='".$_POST['iid']."'");
   echo "<script>alert('Edit is ok');location='".$_POST['urls']."';</script>";
}
?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
<script type='text/javascript' src="../js/islogin.js" charset="gb2312"></script>
<BODY>
<center>
<table width="90%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td height="25" bgcolor="#EEEEF9" style="padding-left:5px;">FAQ&nbsp;&nbsp;<a href="javascript:history.go(-1)">Back</a></td>
  </tr>
</table>
<?php
$rs=mysql_query("select * from faq where id='".$_GET['xg_id']."'");
$row=mysql_fetch_array($rs);
?>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<form method="post" action="" name="form1">
    <tr>
      <td height="30" colspan="3" align="center" bgcolor="#8DA8CF"><strong>Edit FAQ </strong></td>
    </tr>
  <tr>
    <td width="157" height="25" align="center" bgcolor="#8DA8CF">Member Id</td>
    <td width="640" bgcolor="#FFFFFF" style="padding-left:4px;"><?=$row[user_name]?></td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#8DA8CF">content</td>
    <td bgcolor="#FFFFFF" style="padding-left:4px; line-height:20px;"><?=$row[faq_content]?></td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#8DA8CF">Answer</td>
    <td bgcolor="#FFFFFF" style="padding-left:4px;"><textarea name="faq_answer" cols="60" rows="8"><?=$row[faq_answer]?></textarea></td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#8DA8CF">ADD time </td>
    <td bgcolor="#FFFFFF" style="padding-left:4px;"><?=$row[faq_addtime]?></td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#8DA8CF">Audit</td>
    <td bgcolor="#FFFFFF" style="padding-left:4px;"><input name="faq_sh" type="radio" value="1" <?php if($row[faq_sh]==1){echo "checked";}?>>
      &nbsp;Yes&nbsp;&nbsp;
      <input type="radio" name="faq_sh" value="0" <?php if($row[faq_sh]==0){echo "checked";}?>>
      &nbsp;NO</td>
  </tr>
  <tr>
    <td height="25" align="center" bgcolor="#8DA8CF">Is display</td>
    <td bgcolor="#FFFFFF" style="padding-left:4px;"><input type="radio" name="faq_xs" value="1" <?php if($row[faq_xs]==1){echo "checked";}?>>
      &nbsp;Yes&nbsp;&nbsp;
      <input name="faq_xs" type="radio" value="0" <?php if($row[faq_xs]==0){echo "checked";}?>>
      &nbsp;NO</td>
  </tr>
  <tr><input type="hidden" name="tj_act" value="ok"><input type="hidden" name="urls" value="<?=$url?>">
  <input type="hidden" name="iid" value="<?=$row['id']?>">
    <td height="25" colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" value="Save"></td>
    </tr>
  </form>
</table>
</center>
</BODY>
</HTML>